package com.ruoyi.business.controller.fuyou;

import java.math.BigDecimal;

public class RefundCalculator {

    // 定义每个餐别的退款金额
    private static final BigDecimal BREAKFAST_AMOUNT = new BigDecimal("1.00");  // 早餐退款金额
    private static final BigDecimal LUNCH_AMOUNT = new BigDecimal("1.00");     // 午餐退款金额
    private static final BigDecimal DINNER_AMOUNT = new BigDecimal("1.00");    // 晚餐退款金额

    /**
     * 计算总退款金额
     * @param breakfast 是否退早餐
     * @param lunch 是否退午餐
     * @param dinner 是否退晚餐
     * @return 总退款金额
     */
    public static BigDecimal calculateTotalRefund(boolean breakfast, boolean lunch, boolean dinner) {
        //查询出餐费
        BigDecimal totalRefund = BigDecimal.ZERO;
        if (breakfast) {
            totalRefund = totalRefund.add(BREAKFAST_AMOUNT);
        }
        if (lunch) {
            totalRefund = totalRefund.add(LUNCH_AMOUNT);
        }
        if (dinner) {
            totalRefund = totalRefund.add(DINNER_AMOUNT);
        }
        return totalRefund;
    }
}
